Section: editors
Priority: optional
Maintainer: Rob Browning <rlb@defaultvalue.org>
-Build-Depends: mailx, libncurses5-dev, texinfo, liblockfile-dev, librsvg2-dev, libgif-dev | libungif4-dev, libtiff4-dev | libtiff-dev, xaw3dg-dev, libpng12-dev, libjpeg62-dev, libm17n-dev, libotf-dev, libgpm-dev [!hurd-i386 !kfreebsd-i386 !kfreebsd-amd64], libdbus-1-dev, autotools-dev, dpkg-dev (>> 1.10.0), quilt (>= 0.42-1), debhelper (>= 4), libxaw7-dev, sharutils, imagemagick, libgtk2.0-dev, libasound2-dev [!hurd-i386 !kfreebsd-i386 !kfreebsd-amd64]
+Build-Depends: mailx, libncurses5-dev, texinfo, liblockfile-dev, librsvg2-dev, libgif-dev | libungif4-dev, libtiff4-dev | libtiff-dev, xaw3dg-dev, libpng12-dev, libjpeg62-dev, libm17n-dev, libotf-dev, libgpm-dev [!hurd-i386 !kfreebsd-i386 !kfreebsd-amd64], libdbus-1-dev, autoconf, autotools-dev, dpkg-dev (>> 1.10.0), quilt (>= 0.42-1), debhelper (>= 4), libxaw7-dev, sharutils, imagemagick, libgtk2.0-dev, libasound2-dev [!hurd-i386 !kfreebsd-i386 !kfreebsd-amd64]
Standards-Version: 3.7.2
Package: emacs
Section: editors
Priority: optional
Maintainer: Rob Browning <rlb@defaultvalue.org>
-Build-Depends: mailx, libncurses5-dev, texinfo, liblockfile-dev, librsvg2-dev, libgif-dev | libungif4-dev, libtiff4-dev | libtiff-dev, xaw3dg-dev, libpng12-dev, libjpeg62-dev, libm17n-dev, libotf-dev, libgpm-dev [!hurd-i386 !kfreebsd-i386 !kfreebsd-amd64], libdbus-1-dev, autotools-dev, dpkg-dev (>> 1.10.0), quilt (>= 0.42-1), debhelper (>= 4), libxaw7-dev, sharutils, imagemagick, libgtk2.0-dev, libasound2-dev [!hurd-i386 !kfreebsd-i386 !kfreebsd-amd64]
+Build-Depends: mailx, libncurses5-dev, texinfo, liblockfile-dev, librsvg2-dev, libgif-dev | libungif4-dev, libtiff4-dev | libtiff-dev, xaw3dg-dev, libpng12-dev, libjpeg62-dev, libm17n-dev, libotf-dev, libgpm-dev [!hurd-i386 !kfreebsd-i386 !kfreebsd-amd64], libdbus-1-dev, autoconf, autotools-dev, dpkg-dev (>> 1.10.0), quilt (>= 0.42-1), debhelper (>= 4), libxaw7-dev, sharutils, imagemagick, libgtk2.0-dev, libasound2-dev [!hurd-i386 !kfreebsd-i386 !kfreebsd-amd64]
Standards-Version: 3.7.2
Package: emacs
# we'll need to be careful. We'll probably have to build completely
# separate packages from completely separate source trees.
-# In order to keep the autofiles up to date, but avoid any alterations
-# outside of ./debian, we keep the changes made by running a new
-# autoconf, etc. in patches/autofiles.diff. This patch can be
-# automatically regenerated by running "debian/rules autofiles-sync",
-# and this patch should always be maintained as the last one in the
-# patch series.
-
# Note that we use quilt to handle the debian patches. One of the
# biggest differences between quilt and say dpatch is that you have to
# explicitly "quilt add" a file to a patch before you edit it. See
# check-vars - displays how the version number has been parsed.
# buildpackage - build binary packages via dpkg-buildpackage w/suitable args
# prepare-release - prepare and check debs for upload.
-# autofiles-sync - force a new autofiles.diff to be generated.
#
######################################################################
# Handle cross-compiling and don't make ./configure guess.
export DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
-confflags += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
+
+# FOR AUTOCONF 2.52 AND NEWER ONLY
+ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
+ confflags += --build $(DEB_HOST_GNU_TYPE)
+else
+ confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
+endif
LDFLAGS := -g
CFLAGS := -DDEBIAN -g
# Wonder if we could patch emacs to copy/use these files to/from the
# build tree... (See Makefile.in's AUTOGENEL definition.)
protected_files := \
- config.guess \
- config.sub \
lisp/cus-load.el \
lisp/finder-inf.el \
lisp/loaddefs.el \
endef
define checkdir
- @if ! test -s debian/patches/autofiles.diff; \
- then \
- echo; \
- echo "The Debian autofiles patch is not available."; \
- echo "Please run this command:"; \
- echo " debian/rules autofiles-sync"; \
- echo; \
- false; \
- fi
dpkg-parsechangelog > /dev/null
dh_testdir debian/emacsVER.postinst
@if ! test -f src/emacs.c; \
rm -f debian/stamp/setup
rm -f debian/stamp/configure
rm -f debian/stamp/build
+ rm -f configure src/config.in
+ dh_autotools-dev_restoreconfig
-$(MAKE) distclean
cd info && rm -f $$(ls | grep -v COPYING | grep -v '^dir$$')
dh_clean
test ! -e debian/stamp || rmdir debian/stamp
endef
-define update_debian_autofiles_quilt
- $(cleanup_all)
- # Make sure autofiles.diff exists, otherwise patching will fail.
- if ! test -e debian/patches/autofiles.diff; \
- then \
- touch debian/patches/autofiles.diff; \
- fi;
- $(quilt) push $$($(quilt) series | tail -n 2 | head -n 1)
- test "$$($(quilt) next)" = autofiles.diff
- $(quilt) pop
- mkdir -p debian/tmp-autofiles/old
- $(pf); tar cpSf - --exclude ./debian --exclude ./.pc . \
- | tar -C debian/tmp-autofiles/old -xpSf -
- cp -a debian/tmp-autofiles/old debian/tmp-autofiles/new
- cd debian/tmp-autofiles/new && aclocal
- cd debian/tmp-autofiles/new && autoconf
- cd debian/tmp-autofiles/new && autoheader
- cd debian/tmp-autofiles/new && rm -rf autom4te.cache
- cd debian/tmp-autofiles && diff -ruN old new > new.diff; \
- test $$? -eq 1
- $(quilt) import -f -P autofiles.diff debian/tmp-autofiles/new.diff
- $(quilt) header -r autofiles.diff < debian/autofiles-diff-header
- $(patch)
- $(quilt) refresh --no-timestamps autofiles.diff
- $(cleanup_all)
-endef
-deb_trash += debian/tmp-autofiles
-
# If we ever need it, we can create a copy that doesn't assume ./debian/
define deb_sub
perl -p \
cd .. && dpkg-source -b -i'\.git|\.pc' "$(basename $(CURDIR))"
$(check_diff)
+.PHONY: buildpackage
buildpackage:
$(checkdir)
dpkg-buildpackage -D -us -uc -rfakeroot -i'\.git|\.pc'
$(check_diff)
-.PHONY: buildpackage
-
prepare-release:
$(checkdir)
# don't want to be root -- using fakeroot below.
fi
# TODO: make sure we actually installed the binary.
# TODO: run tests (use a check target?)
- @read -p "Regenerate autofiles.diff? [y/n] "; \
- if test "$${REPLY}" == y; \
- then \
- $(MAKE) -f debian/rules autofiles-sync; \
- else \
- true; \
- fi
$(MAKE) -f debian/rules clean
$(MAKE) -f debian/rules buildpackage
test -f ../$(src_name)_$(debian_ver).diff.gz
.PHONY: prepare-release
-# we don't sync this automatically on clean because it's expensive and
-# should only be done by a maintainer with time to deal with any mess
-# it might create.
-autofiles-sync:
- $(update_debian_autofiles_quilt)
-.PHONY: autofiles-sync
-
debian-sync: $(persistent_autogen_files)
.PHONY: force-debian-sync debian-sync
debian/stamp/setup: debian/stamp/patch
$(checkdir)
- cp /usr/share/misc/config.sub .
- cp /usr/share/misc/config.guess .
+ dh_autotools-dev_updateconfig
+ aclocal
+ autoconf
+ autoheader
mkdir -p $(dir $@) && touch $@
# common configure flags